﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using KCMS.BusinessLogic.Interfaces;
using KCMS.BusinessLogic.Models;
using StructureMap;
using AutoMapper;
using KCMS.Web.Models;
namespace KCMS.Controllers
{
    public class MenuController : Controller
    {
        //
        // GET: /Menu/
        private IMenuService menuService = ObjectFactory.GetInstance<IMenuService>();
        public ActionResult Index()
        {
            return View();
        }
        public ActionResult Show(String code)
        {
            Menu menu = menuService.getByCode(code);
            var model = Mapper.Map<Menu, MenuViewModel>(menu);
            return PartialView(model);
        }

    }
}
